//
//  dataSource.m
//  testProject
//
//  Created by Christoph Seitz on 01.05.08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "dataSource.h"


@implementation dataSource
-(IBAction)loadData:(id)sender {
	NSString *temp = [[NSBundle mainBundle] resourcePath];
	path = [[NSString alloc] initWithString:[temp stringByAppendingString:@"/mols/"]];
	NSFileManager *man = [NSFileManager defaultManager];
	data =[[NSMutableArray alloc] initWithArray:[man directoryContentsAtPath:path]];
}
-(void) awakeFromNib {
	[self loadData:nil];
}
- (int)numberOfRowsInTableView:(NSTableView *)aTableView {
	return [data count];
}
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex {
	if ([[aTableColumn identifier] isEqualTo:@"full"]) {
		return [path stringByAppendingString:[data objectAtIndex:rowIndex]];
	}
	return [[data objectAtIndex:rowIndex] stringByDeletingPathExtension];
}
- (void) dealloc
{
	[path release];
	[data release];
	[super dealloc];
}

@end
